-- GENERATED SPELL FOR [Crimson Defender] --


function spell0_10421(pUnit, Event) --@Devotion Aura,Self--
pUnit:FullCastSpellOnTarget(8258,pUnit)
pUnit:RegisterEvent('Sorts_10421', 542, 1)
end

function spell1_10421(pUnit, Event) --@Divine Shield,Self--
pUnit:FullCastSpellOnTarget(13874,pUnit)
pUnit:RegisterEvent('Sorts_10421', 8348, 1)
end

function spell2_10421(pUnit, Event) --@Exorcism,n/a--
pUnit:FullCastSpellOnTarget(17149,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10421', 572, 1)
end

function spell3_10421(pUnit, Event) --@Hammer of Justice,n/a--
pUnit:FullCastSpellOnTarget(13005,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10421', 6345, 1)
end

function spell4_10421(pUnit, Event) --@Holy Light,Heal--
pUnit:FullCastSpellOnTarget(15493,pUnit)
pUnit:RegisterEvent('Sorts_10421', 2500, 1)
end

function Sorts_10421(pUnit, Event)
local choix_sorts_10421 = math.random(0, 4)
if choix_sorts_10421 == 0 then
pUnit:RegisterEvent('spell0_10421', 1, 1)
end
if choix_sorts_10421 == 1 then
pUnit:RegisterEvent('spell1_10421', 1, 1)
end
if choix_sorts_10421 == 2 then
pUnit:RegisterEvent('spell2_10421', 1, 1)
end
if choix_sorts_10421 == 3 then
pUnit:RegisterEvent('spell3_10421', 1, 1)
end
if choix_sorts_10421 == 4 then
pUnit:RegisterEvent('spell4_10421', 1, 1)
end
end

function mob10421_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_10421', math.random(1500, 3000), 1)
end

function mob10421_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10421_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10421_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(10421, 1, 'mob10421_Action')
RegisterUnitEvent(10421, 2, 'mob10421_Leave')
RegisterUnitEvent(10421, 3, 'mob10421_Kill')
RegisterUnitEvent(10421, 4, 'mob10421_Die')
